package com.skydonkey.validator;

import com.skydonkey.utils.JWTUtils;

import javax.servlet.http.HttpServletRequest;

public class AccountValidator {
    public static boolean isValid(HttpServletRequest request, Long uid){
        try {
            Long tokenUid = Long.parseLong(JWTUtils.getUidFromRequest(request));
            return tokenUid.equals(uid);
        }catch (Exception e){
            e.printStackTrace();
        }
        return false;
    }
}
